home *** CD-ROM | disk | FTP | other *** search
- PRG formatted GEOS file V1.0
- LA-50
- MA2Stage
- BLASTER'S CONVERTER V2.5
- ,'MA2RunDA
- Write Image V2.1
- geoWrite V2.1
- This source file was written by
- Joseph Buckley.
- You are free to use this code in
- your own programs and to modify it to suit your
- programming needs.
- For more information contact:
- Joseph Buckley
- 464 Beale St.
- W. Quincy, MA 02169-1307
- Red Storm via Quantum Link
- 71570,2600 via CompuServe
- (GEOS Section Leader, CBMPRG forum)
- ; Date Stamp is a small GEOS Autoexecuting
- ; application which will write the system time
- ; and date du
- ; Date Stamp is a small GEOS Autoexecuting
- ; application which will write the system time
- ; and date during the normal GEOS booting
- ; sequence.
- ; Presetting the time and date information is
- ; accomplished via opening the program from the
- ; GEOS deskTop as you would any normal
- ; application file.
- .if Pass1
- .include geosSym
- .include geosMac
- .endif
- ProgStart:
- lda firstBoot
- ; Check the system variable 'firstBoot' to
- ; see if the GEOS system is being booted from
- ; a cold start.
- ; 'firstBoot' contains $00 until the deskTop
- ; is first run. This indicates a cold boot.
- ; Once the deskTop has been run, 'firstBoot'
- ; contains $ff until the deskTop.
- beq 1$
- jmp GrabDate
- ; If not a booting situation, then merely
- ; copy current system time and date to this
- ; file.
- 1$ jmp SetDate
- ; On a cold boot, set the system time and
- ; date to the preset values within this file.
- .byte 89,8,29,9,00,0
- ; Storage for system time and date.
- GrabDate:
- ; Write system time and date to the disk
- ; based copy of this program.
- LoadW r6,FileName ; buffer for name of disk based copy
- LoadB r7L,AUTO_EXEC ; GEOS file type of disk based copy
- LoadB r7H,1 ; you only want first file found
- LoadW r10,PrmString ; the 'Permanent Name String', or
- ; Class of the disk file
- jsr FindFTypes ; hunt for the disk file name
- ; This code fragment allows you to change the
- ; name of the file on disk and still allow you
- ; to find it via the 'Class' string in the
- ; Information data block of the file.
- LoadW r6,FileName ; we now know the disk file's name
- jsr FindFile ; get the file's directory entry
- MoveW dirEntryBuf+$01,r1 ; copy the Track & Sector
- ; pointer to read its first block
- LoadW r4,$1000 ; data buffer for disk block
- jsr GetBlock ; read the file's first block
- jsr i_MoveData ; copy the year, month and day
- ; from GEOS system RAM to the
- ; proper byte positions within
- ; the data buffer.
- .word year
- .word $100d
- .word $0003
- jsr InitForIO ; swap in the system I/O block
- MoveB cia1base+$0b,$1010 ; read the current hour,
- MoveB cia1base+$0a,$1011 ; minute,
- MoveB cia1base+$09,$1012 ; and second and write them to
- ; the data buffer
- ClrB cia1base+$08 ; restart CIA clock after read
- jsr DoneWithIO ; return to normal GEOS map
- MoveW dirEntryBuf+$01,r1 ; copy the Track & Sector
- ; pointer to write its first block
- LoadW r4,$1000 ; data buffer for disk block
- jsr PutBlock ; wrte the file's first block with
- ; the new date and time data
- jmp EnterDeskTop ; done, return to deskTop
- SetDate:
- ; Read system time and date from the disk
- ; based copy of this program.
- LoadW r6,FileN
- SetDate:
- ; Read system time and date from the disk
- ; based copy of this program.
- LoadW r6,FileName ; buffer for name of disk based copy
- LoadB r7L,AUTO_EXEC ; GEOS file type of disk based copy
- LoadB r7H,1 ; you only want first file found
- LoadW r10,PrmString ; the 'Permanent Name String', or
- ; Class of the disk file
- jsr FindFTypes ; hunt for the disk file name
- ; This code fragment allows you to change the
- ; name of the file on disk and still allow you
- ; to find it via the 'Class' string in the
- ; Information data block of the file.
- LoadW r6,FileName ; we now know the disk file's name
- jsr FindFile ; get the file's directory entry
- MoveW dirEntryBuf+$01,r1 ; copy the Track & Sector
- ; pointer to read its first block
- LoadW r4,$1000 ; data buffer for disk block
- jsr GetBlock ; read the file's first block
- jsr i_MoveData ; copy the year, month and day
- ; from the proper byte positions
- ; within the data buffer to GEOS
- ; system RAM.
- .word $100d
- .word year
- .word $0003
- jsr InitForIO ; swap in the system I/O block
- MoveB $1010,cia1base+$0b ; read the old hour,
- MoveB $1011,cia1base+$0a ; minute,
- MoveB $1012,cia1base+$09 ; and second and write them to
- ; the CIA chip
- ClrB cia1base+$08 ; restart CIA clock after read
- jsr DoneWithIO ; return to normal GEOS map
- jmp EnterDeskTop
- ; done, return to deskTop
- PrmString:
- .byte "Date Set V0.0",0
- ; This is the 'Permanent Name String', or
- ; Class of the disk file we wish to read/write.
- FileName:
- .block $12
- ; This is a small buffer to hold the name of
- ; the program we found via the Class string.
- ProgEnd:
- ; End of program.
- ; End of Assembly file.
-